import React from 'react';
import { Col, Form, Row } from 'antd';
import styles from './index.module.less';

class SearchForm extends React.Component {
  static Item(props) {
    return (
      <Col span={props.span} offset={props.offset}>
        <Form.Item label={props.title} labelCol={props.labelCol}>
          {props.children}
        </Form.Item>
      </Col>
    )
  }

  render() {
    return (
      <div className={styles.searchForm}>
        <Form style={this.props.style}
              labelWrap={this.props.labelWrap ?? true}
              labelCol={this.props.labelCol}
              wrapperCol={this.props.wrapperCol}>
          <Row gutter={{ md: 8, lg: 16, xl: 24 }}>
            {this.props.children}
          </Row>
        </Form>
      </div>
    )
  }
}

export default SearchForm
